#include<iostream>
#include<vector>
using namespace std;

void printVector(vector<int>& v){
	for(vector<int>::iterator iter=v.begin(); iter!=v.end(); iter++){
		cout<<*iter<<" ";
	}
	cout<<endl;
}


int main(){

	vector<int> v={9,8,7,6,5};
	cout<<v[2]<<endl;
	cout<<v.at(2)<<endl;
	

	cout<<"front: "<<v.front()<<endl;
        cout<<"back: "<<v.back()<<endl;

	cout<<"这个地方由于at的原因，这个会产生这个异常"<<endl;
	cout<<v[12]<<endl;
	cout<<"产生了未定义的行为！！！"<<endl;
	cout<<v.at(12)<<endl;




	return 0;
}
